<template>
<div>
    <el-dialog :title="title" :visible.sync="dialogFormVisble" :close-on-click-modal="false" @close="closeDialog">
        <el-form :model="selectTable" :rules="rules" ref="selectTable" label-width="100px" size="small">
          <el-form-item label="分组名称" prop="name" >
            <el-input v-model="selectTable.name"></el-input>
          </el-form-item>
          <el-form-item label="分组ID" prop="id">
            <el-input v-model="selectTable.id"></el-input>
          </el-form-item>
          <el-form-item label="负责人" prop="resPerson">
            <el-select v-model="selectTable.resPerson" placeholder="请选择分组设备负责人">
              <el-option key="1" label="广东省" value="广东省"></el-option>
              <el-option key="2" label="湖南省" value="湖南省"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="联系方式" prop="phone">
            <el-input v-model="selectTable.phone"></el-input>
          </el-form-item>
          <el-form-item label="分组描述" prop="des">
            <el-input type="textarea" v-model="selectTable.des"></el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisble = false">取 消</el-button>
          <el-button type="primary" @click="confirmDialog()">确 定</el-button>
        </div>
      </el-dialog>
</div>
</template>
<script>
export default {
    data() {
        return {
            dialogFormVisble: this.isShow,
            selectTable: {},
            rules: {
                name: [{ required: true, message: '请输入分组名称', trigger: 'blur' }],
                id: [{ required: true, message: '请输入分组ID', trigger: 'blur' }],
                resPerson: [{ required: true, message: '请选择负责人', trigger: 'blur' }],
                phone: [{ required: true, message: '请输入联系方式', trigger: 'blur' }],
                des: [{ required: true, message: '请输入分组描述', trigger: 'blur' }],
            }
        }
    },
    props:['isShow', 'title'],
    methods: {
        //设置弹窗可见
        closeDialog() {
            this.$emit('closeDialog')
        },
        updateDevice() {
            this.dialogFormVisble = true
            this.title = '修改设备'
        },
        hideBcycleFinishDialog() {
            this.bcycleFinishDialog.show = false
        },
        confirmDialog() {
            this.$refs['selectTable'].validate((valid) => {
                if (valid) {
                    
                }
            }); 
        }
    }
}
</script>
<style lang="less" scoped>

</style>

